package com.qd.pay.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 支付结果
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_order_report")
public class OrderReport extends Model<OrderReport> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "order_id", type = IdType.ASSIGN_ID)
    private String orderId;
    /**
     * 支付系统订单号:微信订单号
     */
    @TableField("transaction_id")
    private String transactionId;
    /**
     * 支付完成时间
     */
    @TableField("time_end")
    private LocalDateTime timeEnd;
    /**
     * 付款银行
     */
    @TableField("bank_type")
    private String bankType;
    /**
     * 支付金额:退款就是退款的金额
     */
    @TableField("pay_amount")
    private BigDecimal payAmount;
    /**
     * 业务结果:1.调用支付接口返回的状态 ok.成功 cancel.用户取消 fail.失败
     */
    @TableField("result_code")
    private String resultCode;
    /**
     * 写入时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;

    public void freeData() {
        this.orderId = null;
        this.transactionId = null;
        this.timeEnd = null;
        this.bankType = null;
        this.payAmount = null;
        this.resultCode = null;
        this.addTime = null;
    }

}
